package nc.task.hdysc;

import java.util.List;
import java.util.Map;

import nc.bs.dao.BaseDAO;
import nc.bs.dao.DAOException;
import nc.hdysc.engine.impl.BaseSyncDataImpl;
import nc.hdysc.engine.itf.ISyncTask;
import nc.hdysc.pub.BaseUtil;
import nc.jdbc.framework.processor.MapListProcessor;
import nc.vo.hdysc.engine.SyncTaskVO;
import nc.vo.hdysc.scenery.SceneryChildVO;

public class SceneryChildZHPTask extends BaseSyncDataImpl<SceneryChildVO> implements ISyncTask<SceneryChildVO> {

	
	//private SyncTaskVO syncTaskVO;
	public SceneryChildZHPTask() throws DAOException, InstantiationException, IllegalAccessException, ClassNotFoundException {
		super( SceneryChildVO.class);
	}

	public List<SceneryChildVO> getDstDate() throws DAOException {
		List<SceneryChildVO> sceneryChildList = (List<SceneryChildVO>) dDao.retrieveAll(SceneryChildVO.class);
		return sceneryChildList;
	}

	public List<Map<String, Object>> getSourceDate() throws DAOException {
		String sql = "select * from tbdproductionchild_ZHP";
		List<Map<String, Object>> sceneryChildList = (List<Map<String, Object>>) sDao.executeQuery(sql, new MapListProcessor());
		return sceneryChildList;
	}

	public SyncTaskVO getSyncTask() throws DAOException {
		SyncTaskVO syncTask = null;
		BaseDAO dao = new BaseDAO();
		syncTask = (SyncTaskVO) dao.retrieveByPK(SyncTaskVO.class, "0001AA10000000006PIJ");
		return syncTask;
	}

	public SceneryChildVO afterMethod(SceneryChildVO t) {
		return t;
	}

	public int compare(SceneryChildVO sVO, SceneryChildVO dVO) {
		int compare = -1;
		String dPk_poduct = dVO.getPk_poduct();
		String sPk_poduct = sVO.getPk_poduct();
		String dPk_scenery = dVO.getPk_scenery();
		String sPk_scenery = sVO.getPk_scenery();
		if(BaseUtil.equals(dPk_poduct,sPk_poduct) && BaseUtil.equals(dPk_scenery,sPk_scenery)){
			compare =  1;
		}
		return compare;
	}

	public SceneryChildVO beforeUpdateOrInsert(SceneryChildVO t) {
		return t;
	}

}
